﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace PubSubLite.Configuration
{
    public class TcpChannelConfigElement : ConfigurationElement
    {
        [ConfigurationProperty("hostPort", IsRequired=true)]
        public int HostPort
        {
            get
            {
                if (this["hostPort"] == null)
                {
                    return 0;
                }
                return (int)this["hostPort"];
            }
            set
            {
                this["hostPort"] = value;
            }
        }

        [ConfigurationProperty("clientUri", IsRequired=true)]
        public string ClientUri
        {
            get
            {
                if (this["clientUri"] == null)
                {
                    return string.Empty;
                }
                return this["clientUri"].ToString();
            }
            set
            {

            }
        }

        [ConfigurationProperty("clientPort", IsRequired=true)]
        public int ClientPort
        {
            get
            {
                if (this["clientPort"] == null)
                {
                    return 0;
                }
                return (int)this["clientPort"];
            }
            set
            {
                this["clientPort"] = value;
            }
        }
    }
}
